import { CustomField } from '@/anyThing/decorator/CustomField'
import { FormField } from '@/anyThing/decorator/FormField'
import { AnyDataBaseEntity } from '@/anyThing/entity/AnyDataBaseEntity'
import { EFormItemType } from '@/anyThing/enum/EFormItemType'
import { AnyDictionaryHelper } from '@/anyThing/helper/AnyDictionaryHelper'

enum OptionsEnum {
  ONE = 'one',
  TWO = 'two',
  THREE = 'three',
}

const OptionsDict = AnyDictionaryHelper.createDictionaryArray([
  { value: OptionsEnum.ONE, label: '选项1' },
  { value: OptionsEnum.TWO, label: '选项2' },
  { value: OptionsEnum.THREE, label: '选项3' },
])
export class DemoEntity extends AnyDataBaseEntity {
  @FormField()
  @CustomField('字符串')
  string?: string

  @FormField({ formType: EFormItemType.TEXTAREA })
  @CustomField('文本域')
  textarea?: string

  @FormField({ formType: EFormItemType.CHECKBOX })
  @CustomField('复选框', OptionsDict)
  checkbox?: string

  @FormField({ formType: EFormItemType.DATE })
  @CustomField('日期选择器')
  datePicker?: string
}
